﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using BXH.Movie.FrmUsers;
using BXH.Movie.Model;

namespace BXH.Movie.Forms
{
    public partial class UCTicket : UserControl
    {
        private MovieInfoDto _movieInfo;
        public UCTicket(MovieInfoDto movieInfo)
        {
            InitializeComponent();
            _movieInfo = movieInfo;
        }

        private void UCTicket_Load(object sender, EventArgs e)
        {

        }

        public void SetImage(string ImagePath)
        {
            try
            {
                if (!string.IsNullOrEmpty(ImagePath))
                {
                    this.PicLogo.BackgroundImage = Image.FromFile(ImagePath);
                    this.PicLogo.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Zoom;
                }
            }
            catch (Exception)
            {

            }
        }

        public void SetName(string name)
        {
            this.label1.Text = name;
        }

        private void BtnBuy_Click(object sender, EventArgs e)
        {
            this.Buy();
        }

        private void PicLogo_Click(object sender, EventArgs e)
        {
            this.Buy();
        }

        private void Buy()
        {
            UCCheckMovieInfo uCCheckMovieInfo = new UCCheckMovieInfo(_movieInfo);
            FrmMain._FrmMain.SetManageOtherShow(uCCheckMovieInfo);
        }
    }
}
